package vn.qnamuni.calendar.utils;

import vn.qnamuni.calendar.constants.PersonContract;

public class User {

	private String name;
	private String date;
	private String avatarUrl;
	private String uid;
	
	public User(){
		name = "";
		avatarUrl = "";
		date = "";
		uid = "";
	}
	
	public User(String uid, String name, String date, String avtUrl) {
		super();
		this.uid = uid;
		this.name = name;
		this.avatarUrl = avtUrl;
		this.date = date;
	}
	
	public String getAttribute(String tag) {
		if (tag.equals(PersonContract.Entry.KEY_NAME)) {
			return name;
		}
		if (tag.equals(PersonContract.Entry.KEY_UID)) {
			return String.valueOf(uid);
		}
		if (tag.equals(PersonContract.Entry.KEY_DATE)) {
			return date;
		}
		if (tag.equals(PersonContract.Entry.KEY_MESSAGE)) {
			return "";
		}
		if (tag.equals(PersonContract.Entry.KEY_FADDRESS)) {
			return avatarUrl;
		}
		return "";
	}
	
	public void setAttribute(String tag, String sValue) {
		if (tag.equals(PersonContract.Entry.KEY_NAME)) {
			name = sValue;
		}
		if (tag.equals(PersonContract.Entry.KEY_UID)) {
			uid = sValue;
		}
		if (tag.equals(PersonContract.Entry.KEY_DATE)) {
			date = sValue;
		}
		if (tag.equals(PersonContract.Entry.KEY_MESSAGE)) {
			
		}
		if (tag.equals(PersonContract.Entry.KEY_FADDRESS)) {
			avatarUrl = sValue;
		}
	}
}
